package com.zhuhanpeng.cloud.user.service;

import com.zhuhanpeng.cloud.api.entity.registerEntity;
import com.zhuhanpeng.cloud.exception.EmailExitException;
import com.zhuhanpeng.cloud.exception.MobileExitException;
import com.zhuhanpeng.cloud.exception.UserNameExitException;
import com.zhuhanpeng.cloud.mybatis.entity.PtUserEntity;
import com.zhuhanpeng.cloud.mybatis.flexigrid.PadingRstType;
import com.zhuhanpeng.cloud.mybatis.flexigrid.PagingEntity;
import com.zhuhanpeng.cloud.mybatis.ztree.ZtreeEntity;
import com.zhuhanpeng.cloud.user.entity.SearchUserEntity;
import com.zhuhanpeng.cloud.user.entity.UserEntity;
import com.zhuhanpeng.cloud.user.exception.PasswordError;

import java.util.List;

public interface UserService {
    void modifyPassword(String oldPassword, String newPassword) throws PasswordError;

    /**
     * 分页查询用户列表
     * @param entity
     * @param paging
     * @return
     */
    PadingRstType<PtUserEntity> queryUserInfoListByPage(SearchUserEntity entity, PagingEntity paging);
    /**
     * 增加用户
     * @param entity
     */
    void addUser(UserEntity entity) throws UserNameExitException, EmailExitException, MobileExitException;



    /**
     * 根据用户ID查询用户信息
     * @param userUuid
     * @return
     */
    UserEntity queryUserInfoById(String userUuid);

    /**
     * 根据用户ID修改用户信息
     * @param entity
     */
    void modifyUser(UserEntity entity) throws UserNameExitException, EmailExitException, MobileExitException;
    /**
     * 根据IDS批量删除用户
     * @param userUuids
     */
    void deleteUserInfoByIds(String userUuids);
    /**
     * 根据用户ID，查询角色列表Ztree
     * @param userUuid
     * @return
     */
    List<ZtreeEntity> queryRoleZtreeByUserId(String userUuid);
    /**
     * 分配角色
     * @param userUuid
     * @param rolesArray
     */

    void saveRoleRefUser(String userUuidArray, String rolesArray);

    /**
     * 查询所有角色Ztree列表
     * @return
     */
    List<ZtreeEntity> queryRoleZtreeAll();
    /**
     * 重置密码
     * @param userUuidArray
     * @param password
     */
    void resetPassword(String userUuidArray, String password);
}
